<div class="layui-tab">
    <ul class="layui-tab-title">
        <?php if($type==1 || empty($type)){ ?>
            <li class="layui-this"><a href="<?=base_url("/material/material/index")?>">原始素材</a></li>
            <li><a href="<?=base_url("/material/material/join")?>">挑选视频</a></li>
            <li><a href="<?=base_url("/material/material/drop")?>">弃用</a></li>
        <?php }else if($type==2){ ?>
            <li><a href="<?=base_url("/material/material/index")?>">原始素材</a></li>
            <li class="layui-this"><a href="<?=base_url("/material/material/join")?>">挑选视频</a></li>
            <li><a href="<?=base_url("/material/material/drop")?>">弃用</a></li>
        <?php }else if($type==3){ ?>
            <li><a href="<?=base_url("/material/material/index")?>">原始素材</a></li>
            <li><a href="<?=base_url("/material/material/join")?>">挑选视频</a></li>
            <li class="layui-this"><a href="<?=base_url("/material/material/drop")?>">弃用</a></li>
        <?php } ?>
        <li style="float: right;"><a href="<?=base_url("/material/material/add_material")?>" class="layui-btn">添加原始素材</a></li>

    </ul>
</div>

<form class="layui-form" id="search-form">
    <div style="min-height: 38px;margin-top: 5px;">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select name="city" lay-filter="join_type_sub">
                    <option value="">话题选择</option>
                    <?php if(!empty($type_sub)){
                        foreach($type_sub as $c=>$d){
                            ?>
                            <a href="<?=base_url("material/material/index?type_id={$d['id']}")?>">
                                <option value="<?=$d['id']?>" class="type_id<?=$c+1?>"><?=$d['sub_title']?></option>
                            </a>
                        <?php }} ?>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">日期范围</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input time" id="test6" placeholder="" style="width:200px;">
            </div>
        </div>
        <button type="button" class="layui-btn layui-btn-primary search"><i class="layui-icon">&#xe615;</i> </button>
        <?php if($type==2){ ?>
        <span style="float: right;">
            <?php if(!empty($sort)){ ?>
                <a href="<?=base_url("material/material/join?sort=1")?>" style="color: #00CC00;">排序值</a> &nbsp&nbsp | &nbsp&nbsp
            <?php }else if(empty($sort)){ ?>
                <a href="<?=base_url("material/material/join?sort=1")?>">排序值</a> &nbsp&nbsp | &nbsp&nbsp
            <?php } ?>
            <?php if(!empty($dub_num)){ ?>
                <a href="<?=base_url("material/material/join?dub_num=1")?>" style="color: #00CC00;">配音次数</a> &nbsp&nbsp | &nbsp&nbsp
            <?php }else if(empty($dub_num)){ ?>
                <a href="<?=base_url("material/material/join?dub_num=1")?>">配音次数</a> &nbsp&nbsp | &nbsp&nbsp
            <?php } ?><?php if(!empty($times)){ ?>
                <a href="<?=base_url("material/material/join?times=1")?>" style="color: #00CC00;">时间</a>
            <?php }else if(empty($times)){ ?>
                <a href="<?=base_url("material/material/join?times=1")?>">时间</a>
            <?php } ?>


        </span>
        <?php } ?>
    </div>
</form>

<script>
    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
    $(function(){
        layui.use('element', function(){
            var element = layui.element;

            //…
        });
        //日期选择
        layui.use('laydate', function() {
            var laydate = layui.laydate;

            //日期范围
            laydate.render({
                elem: '#test6'
                ,range: '~'
            });
        })
    })

</script>